<template>
    <fieldset>
        <legend>父组件</legend>
        <h1>{{ msg }}</h1>
        <!-- v-model绑定 -->
        <fieldset>
            <legend>model的值</legend>
            <h1>{{ val }}</h1>
            <h1>{{ val2 }}</h1>
        </fieldset>
        <Child v-model:msg1="val" v-model:msg2="val2"></Child>
        <button @click="send">送书给兄die</button>
    </fieldset>
</template>
<script>
// import bus from "../../eventBus"

import Child from "../Child"
export default {
    data() {
        return {
            msg: "父组件",
            val: "vue3.0真好学",
            val2: "第二个model",
            toBro: "你不知道的js"
        }
    },
    components: {
        Child
    },
    methods: {
        send() {
            //发布者
            this.$bus.$emit("toBro",this.toBro)
        }
    }
}
</script>